<?php

class HistoricoSituacaoService extends Model {

    /**
     * @var HistoricoSituacaoDao
     */
    private $historicoSituacaoDao;
    /**
     * @var ClienteService
     */
    private $clienteService;

    public function injectDependencies() {
        $this->historicoSituacaoDao = HistoricoSituacaoDao::getInstance();
        $this->clienteService = ClienteService::getInstance();
    }

    public function findCustomerBySituationFilter($IDFilter, $filterType) {
        if($IDFilter == 'list-delinquent') {
            return $this->clienteService->findWithPendingMonthly();
        } else if($IDFilter == 'list-delay') {
            return $this->clienteService->findBySituation('ATRASO');
        } else if($IDFilter == 'list-prefreeze') {
            return $this->clienteService->findBySituation('PRE CONGELADO');
        } else if($IDFilter == 'list-freeze') {
            return $this->clienteService->findBySituation('CONGELADO');
        }
    }

    public function findByCustomer($IDCliente) {
        return $this->historicoSituacaoDao->findByCustomer($IDCliente);
    }

    public function findDelinquentCustomer() {
        return $this->historicoSituacaoDao->findDeliquentsCustomers();
    }

    public function getHeadLineSituationFor($EnSituation) {
        return $this->historicoSituacaoDao->getHeadLineSituationFor($EnSituation);
    }

    public function findPunctualCustomers() {
        $ArCustomers = $this->historicoSituacaoDao->findPunctualCustomers();
        $this->clienteService->fillCustomer($ArCustomers);
        return $ArCustomers;
    }

}

?>
